package com.whatech.mall.product.service.impl;

import com.whatech.mall.product.model.entity.Product;
import com.whatech.mall.product.service.ProductService;
import org.springframework.stereotype.Service;

import java.util.UUID;
import java.util.concurrent.ThreadLocalRandom;

@Service
public class ProductServiceImpl implements ProductService {

    @Override
    public Product findById(Long id) {
        Product product = new Product();
        product.setId(id);
        product.setName("product-" + id);
        product.setSn(UUID.randomUUID().toString());
        product.setPrice(ThreadLocalRandom.current().nextDouble(1, 1000));
        return product;
    }

}
